﻿#pragma once


#include <QListWidget>
#include <QListWidgetItem>
#include <QShortcut>
#include "CustomListWidgetItem.h"
#include <QApplication>
#include <QSplitter>
#include <QTreeWidget>
#include <QTreeWidgetItem>
#include <QTreeView>
#include <QHeaderView>
#include <QTabWidget>
#include <QWidget>
#include <QMenuBar>
#include <QDockWidget>
#include <QToolbar>
#include <QMainWindow>
#include <QPushButton>
#include <QTextEdit>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QTextBlock>
#include <QTextDocumentFragment>
#include "ui_myNotePad.h"
#include "NotePage.h"
#include <QUrl>
#include <QDesktopServices>



class myNotePad : public QMainWindow, public NotePage
{
	Q_OBJECT

public:
	myNotePad(QWidget* parent = nullptr);
	~myNotePad();
	void Saveship(int n);
private:
	Ui::myNotePadClass ui;
	//QAction* actionSourceCodeMode;
	//bool isSourceCodeMode;
	
	/*	新建widget(控件)代码，添加在该函数；
		为添加的widget(控件)设置、加载样式or属性
		(若代码多导致函数体过长	请考虑单独封装为函数后调用！（函数文件放置在Interface项目文件夹中）)
	*/
	void loadWidget();


private slots:

	void newActionSlot();
	void openActionSlot();
	void saveActionSlot();
	void saveAsActionSlot();
	void closeActionSlot();

	void undoActionSlot();
	void cutActionSlot();
	void copyActionSlot();
	void pasteActionSlot();
	void copyAsPlainTextActionSlot();
	void copyAsMarkdownSlot();
	void copyAsHTMLSlot();
	void emojiAndSymbolsActionSlot();

	void headingActionSlot();
	void headingActionSlot(int n);
	void increaseHeadingLevelActionSlot();
	void decreaseHeadingLevelActionSlot();
	void tableActionSlot();
	void codeFencesActionSlot();
	void mathBlockActionSlot();
	void quoteActionSlot();

	void mergeFormat(QTextCharFormat);
	void strongActionSlot();
	void emphasisActionSlot();
	void underLineActionSlot();
	void codeActionSlot();
	void strikeActionSlot();
	void hyperlinkActionSlot();
	void clearFormatActionSlot();

	void toggleSidebarActionSlot();
	void outlineActionSlot();
	void searchActionSlot();
	void soureCodeModeActionSlot();
	void focusModeActionSlot();
	void typewriterModeActionSlot();
	void actualSizeActionSlot();
	void zoomInActionSlot();
	void zoomOutActionSlot();

	void githubActionSlot();
	void NewsprintActionSlot();
	void NightActionSlot();
	void PixyllActionSlot();
	void WhiteyActionSlot();

	//鼠标内容的提取
	void onConvertClicked();
	//文本格式保持（未完成）
	void chargeText();
	//渲染样式
	void insertdisplay();
};
